package com.seckill.goods.controller;

import com.seckill.goods.pojo.Brand;
import com.seckill.goods.service.BrandService;
import com.seckill.util.Result;
import com.seckill.util.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @program: seckill-parent
 * @description: 品牌相关操作
 * @author: zhanghz001
 * @create: 2021-06-24 17:46
 **/
// @RestController
@RequestMapping(value = "/brand/")
@CrossOrigin
public class ZhzBrandController {
    @Autowired
    private BrandService brandService;
    
    @GetMapping
    public Result<List<Brand>> findAll() {
        //调用BrandService实现查询所有Brand
        List<Brand> list = brandService.findAll();
        return new Result<>(true, StatusCode.OK, "获取所有品牌成功", list);
    }
}
